package com.weic.easycache.exception;

public class ApiErrorException extends Exception {
	private static final long serialVersionUID = -2394998335811042868L;
	
	private String lmsg;

	public ApiErrorException(String message) {
		super(message);

		String s = message;
		if(s != null) {
			s = s.trim();
			int i = s.indexOf('\n');
			if(i > 0) s = s.substring(0, i);
			if(s.length() > 30) s = s.substring(0, 30);
		}
		lmsg = s;
	}
	
	@Override
	public String getLocalizedMessage() {
		return lmsg;
	}
}
